<?php

class AdminController extends Zend_Controller_Action {

    public static $SESSION_USERNAME = "username";
    
    public function indexAction() {
        
    }

    public function logoutAction() {
        $auth = Zend_Auth::getInstance();
        $auth->clearIdentity();
    }

    public function loginAction() {
        $userName = $this->_request->getParam("u");
        $passWord = $this->_request->getParam("p");
        $error = $this->_request->getParam('error');
        
        $user = new Model_User();
        $flag = $user->validateUserByUserName($userName, $passWord);

        if ($flag == true) {
            $this->_redirect('/tool/girl');
        } else {
            $this->view->error = $error;
            $this->_redirect('admin?error=-110', array());
        }
    }

}

?>
